<?php


abstract class BaseRegistrationPeer {

	
	const DATABASE_NAME = 'propel';

	
	const TABLE_NAME = 'conf_registration';

	
	const CLASS_DEFAULT = 'lib.model.Registration';

	
	const NUM_COLUMNS = 19;

	
	const NUM_LAZY_LOAD_COLUMNS = 0;


	
	const ID = 'conf_registration.ID';

	
	const INVOICE = 'conf_registration.INVOICE';

	
	const REGISTRANT_ID = 'conf_registration.REGISTRANT_ID';

	
	const CONFERENCE_ID = 'conf_registration.CONFERENCE_ID';

	
	const STATUS = 'conf_registration.STATUS';

	
	const BILL_FIRST_NAME = 'conf_registration.BILL_FIRST_NAME';

	
	const BILL_LAST_NAME = 'conf_registration.BILL_LAST_NAME';

	
	const BILL_ADDRESS = 'conf_registration.BILL_ADDRESS';

	
	const BILL_CITY = 'conf_registration.BILL_CITY';

	
	const BILL_STATE = 'conf_registration.BILL_STATE';

	
	const BILL_ZIPCODE = 'conf_registration.BILL_ZIPCODE';

	
	const BILL_COUNTRY = 'conf_registration.BILL_COUNTRY';

	
	const TOTAL_FEE = 'conf_registration.TOTAL_FEE';

	
	const TOTAL_PAID = 'conf_registration.TOTAL_PAID';

	
	const PAYMENT_VERIFIED = 'conf_registration.PAYMENT_VERIFIED';

	
	const ISDAILY = 'conf_registration.ISDAILY';

	
	const ISEARLY = 'conf_registration.ISEARLY';

	
	const BADGEDATE = 'conf_registration.BADGEDATE';

	
	const CREATED_AT = 'conf_registration.CREATED_AT';

	
	private static $phpNameMap = null;


	
	private static $fieldNames = array (
		BasePeer::TYPE_PHPNAME => array ('Id', 'Invoice', 'RegistrantId', 'ConferenceId', 'Status', 'BillFirstName', 'BillLastName', 'BillAddress', 'BillCity', 'BillState', 'BillZipcode', 'BillCountry', 'TotalFee', 'TotalPaid', 'PaymentVerified', 'Isdaily', 'Isearly', 'Badgedate', 'CreatedAt', ),
		BasePeer::TYPE_COLNAME => array (RegistrationPeer::ID, RegistrationPeer::INVOICE, RegistrationPeer::REGISTRANT_ID, RegistrationPeer::CONFERENCE_ID, RegistrationPeer::STATUS, RegistrationPeer::BILL_FIRST_NAME, RegistrationPeer::BILL_LAST_NAME, RegistrationPeer::BILL_ADDRESS, RegistrationPeer::BILL_CITY, RegistrationPeer::BILL_STATE, RegistrationPeer::BILL_ZIPCODE, RegistrationPeer::BILL_COUNTRY, RegistrationPeer::TOTAL_FEE, RegistrationPeer::TOTAL_PAID, RegistrationPeer::PAYMENT_VERIFIED, RegistrationPeer::ISDAILY, RegistrationPeer::ISEARLY, RegistrationPeer::BADGEDATE, RegistrationPeer::CREATED_AT, ),
		BasePeer::TYPE_FIELDNAME => array ('id', 'invoice', 'registrant_id', 'conference_id', 'status', 'bill_first_name', 'bill_last_name', 'bill_address', 'bill_city', 'bill_state', 'bill_zipcode', 'bill_country', 'total_fee', 'total_paid', 'payment_verified', 'isdaily', 'isearly', 'badgedate', 'created_at', ),
		BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, )
	);

	
	private static $fieldKeys = array (
		BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Invoice' => 1, 'RegistrantId' => 2, 'ConferenceId' => 3, 'Status' => 4, 'BillFirstName' => 5, 'BillLastName' => 6, 'BillAddress' => 7, 'BillCity' => 8, 'BillState' => 9, 'BillZipcode' => 10, 'BillCountry' => 11, 'TotalFee' => 12, 'TotalPaid' => 13, 'PaymentVerified' => 14, 'Isdaily' => 15, 'Isearly' => 16, 'Badgedate' => 17, 'CreatedAt' => 18, ),
		BasePeer::TYPE_COLNAME => array (RegistrationPeer::ID => 0, RegistrationPeer::INVOICE => 1, RegistrationPeer::REGISTRANT_ID => 2, RegistrationPeer::CONFERENCE_ID => 3, RegistrationPeer::STATUS => 4, RegistrationPeer::BILL_FIRST_NAME => 5, RegistrationPeer::BILL_LAST_NAME => 6, RegistrationPeer::BILL_ADDRESS => 7, RegistrationPeer::BILL_CITY => 8, RegistrationPeer::BILL_STATE => 9, RegistrationPeer::BILL_ZIPCODE => 10, RegistrationPeer::BILL_COUNTRY => 11, RegistrationPeer::TOTAL_FEE => 12, RegistrationPeer::TOTAL_PAID => 13, RegistrationPeer::PAYMENT_VERIFIED => 14, RegistrationPeer::ISDAILY => 15, RegistrationPeer::ISEARLY => 16, RegistrationPeer::BADGEDATE => 17, RegistrationPeer::CREATED_AT => 18, ),
		BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'invoice' => 1, 'registrant_id' => 2, 'conference_id' => 3, 'status' => 4, 'bill_first_name' => 5, 'bill_last_name' => 6, 'bill_address' => 7, 'bill_city' => 8, 'bill_state' => 9, 'bill_zipcode' => 10, 'bill_country' => 11, 'total_fee' => 12, 'total_paid' => 13, 'payment_verified' => 14, 'isdaily' => 15, 'isearly' => 16, 'badgedate' => 17, 'created_at' => 18, ),
		BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, )
	);

	
	public static function getMapBuilder()
	{
		include_once 'lib/model/map/RegistrationMapBuilder.php';
		return BasePeer::getMapBuilder('lib.model.map.RegistrationMapBuilder');
	}
	
	public static function getPhpNameMap()
	{
		if (self::$phpNameMap === null) {
			$map = RegistrationPeer::getTableMap();
			$columns = $map->getColumns();
			$nameMap = array();
			foreach ($columns as $column) {
				$nameMap[$column->getPhpName()] = $column->getColumnName();
			}
			self::$phpNameMap = $nameMap;
		}
		return self::$phpNameMap;
	}
	
	static public function translateFieldName($name, $fromType, $toType)
	{
		$toNames = self::getFieldNames($toType);
		$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
		if ($key === null) {
			throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
		}
		return $toNames[$key];
	}

	

	static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
	{
		if (!array_key_exists($type, self::$fieldNames)) {
			throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
		}
		return self::$fieldNames[$type];
	}

	
	public static function alias($alias, $column)
	{
		return str_replace(RegistrationPeer::TABLE_NAME.'.', $alias.'.', $column);
	}

	
	public static function addSelectColumns(Criteria $criteria)
	{

		$criteria->addSelectColumn(RegistrationPeer::ID);

		$criteria->addSelectColumn(RegistrationPeer::INVOICE);

		$criteria->addSelectColumn(RegistrationPeer::REGISTRANT_ID);

		$criteria->addSelectColumn(RegistrationPeer::CONFERENCE_ID);

		$criteria->addSelectColumn(RegistrationPeer::STATUS);

		$criteria->addSelectColumn(RegistrationPeer::BILL_FIRST_NAME);

		$criteria->addSelectColumn(RegistrationPeer::BILL_LAST_NAME);

		$criteria->addSelectColumn(RegistrationPeer::BILL_ADDRESS);

		$criteria->addSelectColumn(RegistrationPeer::BILL_CITY);

		$criteria->addSelectColumn(RegistrationPeer::BILL_STATE);

		$criteria->addSelectColumn(RegistrationPeer::BILL_ZIPCODE);

		$criteria->addSelectColumn(RegistrationPeer::BILL_COUNTRY);

		$criteria->addSelectColumn(RegistrationPeer::TOTAL_FEE);

		$criteria->addSelectColumn(RegistrationPeer::TOTAL_PAID);

		$criteria->addSelectColumn(RegistrationPeer::PAYMENT_VERIFIED);

		$criteria->addSelectColumn(RegistrationPeer::ISDAILY);

		$criteria->addSelectColumn(RegistrationPeer::ISEARLY);

		$criteria->addSelectColumn(RegistrationPeer::BADGEDATE);

		$criteria->addSelectColumn(RegistrationPeer::CREATED_AT);

	}

	const COUNT = 'COUNT(conf_registration.ID)';
	const COUNT_DISTINCT = 'COUNT(DISTINCT conf_registration.ID)';

	
	public static function doCount(Criteria $criteria, $distinct = false, $con = null)
	{
				$criteria = clone $criteria;

				$criteria->clearSelectColumns()->clearOrderByColumns();
		if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
			$criteria->addSelectColumn(RegistrationPeer::COUNT_DISTINCT);
		} else {
			$criteria->addSelectColumn(RegistrationPeer::COUNT);
		}

				foreach($criteria->getGroupByColumns() as $column)
		{
			$criteria->addSelectColumn($column);
		}

		$rs = RegistrationPeer::doSelectRS($criteria, $con);
		if ($rs->next()) {
			return $rs->getInt(1);
		} else {
						return 0;
		}
	}
	
	public static function doSelectOne(Criteria $criteria, $con = null)
	{
		$critcopy = clone $criteria;
		$critcopy->setLimit(1);
		$objects = RegistrationPeer::doSelect($critcopy, $con);
		if ($objects) {
			return $objects[0];
		}
		return null;
	}
	
	public static function doSelect(Criteria $criteria, $con = null)
	{
		return RegistrationPeer::populateObjects(RegistrationPeer::doSelectRS($criteria, $con));
	}
	
	public static function doSelectRS(Criteria $criteria, $con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(self::DATABASE_NAME);
		}

		if (!$criteria->getSelectColumns()) {
			$criteria = clone $criteria;
			RegistrationPeer::addSelectColumns($criteria);
		}

				$criteria->setDbName(self::DATABASE_NAME);

						return BasePeer::doSelect($criteria, $con);
	}
	
	public static function populateObjects(ResultSet $rs)
	{
		$results = array();
	
				$cls = RegistrationPeer::getOMClass();
		$cls = Propel::import($cls);
				while($rs->next()) {
		
			$obj = new $cls();
			$obj->hydrate($rs);
			$results[] = $obj;
			
		}
		return $results;
	}

	
	public static function doCountJoinRegistrant(Criteria $criteria, $distinct = false, $con = null)
	{
				$criteria = clone $criteria;

				$criteria->clearSelectColumns()->clearOrderByColumns();
		if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
			$criteria->addSelectColumn(RegistrationPeer::COUNT_DISTINCT);
		} else {
			$criteria->addSelectColumn(RegistrationPeer::COUNT);
		}

				foreach($criteria->getGroupByColumns() as $column)
		{
			$criteria->addSelectColumn($column);
		}

		$criteria->addJoin(RegistrationPeer::REGISTRANT_ID, RegistrantPeer::ID);

		$rs = RegistrationPeer::doSelectRS($criteria, $con);
		if ($rs->next()) {
			return $rs->getInt(1);
		} else {
						return 0;
		}
	}


	
	public static function doCountJoinConference(Criteria $criteria, $distinct = false, $con = null)
	{
				$criteria = clone $criteria;

				$criteria->clearSelectColumns()->clearOrderByColumns();
		if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
			$criteria->addSelectColumn(RegistrationPeer::COUNT_DISTINCT);
		} else {
			$criteria->addSelectColumn(RegistrationPeer::COUNT);
		}

				foreach($criteria->getGroupByColumns() as $column)
		{
			$criteria->addSelectColumn($column);
		}

		$criteria->addJoin(RegistrationPeer::CONFERENCE_ID, ConferencePeer::ID);

		$rs = RegistrationPeer::doSelectRS($criteria, $con);
		if ($rs->next()) {
			return $rs->getInt(1);
		} else {
						return 0;
		}
	}


	
	public static function doSelectJoinRegistrant(Criteria $c, $con = null)
	{
		$c = clone $c;

				if ($c->getDbName() == Propel::getDefaultDB()) {
			$c->setDbName(self::DATABASE_NAME);
		}

		RegistrationPeer::addSelectColumns($c);
		$startcol = (RegistrationPeer::NUM_COLUMNS - RegistrationPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
		RegistrantPeer::addSelectColumns($c);

		$c->addJoin(RegistrationPeer::REGISTRANT_ID, RegistrantPeer::ID);
		$rs = BasePeer::doSelect($c, $con);
		$results = array();

		while($rs->next()) {

			$omClass = RegistrationPeer::getOMClass();

			$cls = Propel::import($omClass);
			$obj1 = new $cls();
			$obj1->hydrate($rs);

			$omClass = RegistrantPeer::getOMClass();

			$cls = Propel::import($omClass);
			$obj2 = new $cls();
			$obj2->hydrate($rs, $startcol);

			$newObject = true;
			foreach($results as $temp_obj1) {
				$temp_obj2 = $temp_obj1->getRegistrant(); 				if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
					$newObject = false;
										$temp_obj2->addRegistration($obj1); 					break;
				}
			}
			if ($newObject) {
				$obj2->initRegistrations();
				$obj2->addRegistration($obj1); 			}
			$results[] = $obj1;
		}
		return $results;
	}


	
	public static function doSelectJoinConference(Criteria $c, $con = null)
	{
		$c = clone $c;

				if ($c->getDbName() == Propel::getDefaultDB()) {
			$c->setDbName(self::DATABASE_NAME);
		}

		RegistrationPeer::addSelectColumns($c);
		$startcol = (RegistrationPeer::NUM_COLUMNS - RegistrationPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
		ConferencePeer::addSelectColumns($c);

		$c->addJoin(RegistrationPeer::CONFERENCE_ID, ConferencePeer::ID);
		$rs = BasePeer::doSelect($c, $con);
		$results = array();

		while($rs->next()) {

			$omClass = RegistrationPeer::getOMClass();

			$cls = Propel::import($omClass);
			$obj1 = new $cls();
			$obj1->hydrate($rs);

			$omClass = ConferencePeer::getOMClass();

			$cls = Propel::import($omClass);
			$obj2 = new $cls();
			$obj2->hydrate($rs, $startcol);

			$newObject = true;
			foreach($results as $temp_obj1) {
				$temp_obj2 = $temp_obj1->getConference(); 				if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
					$newObject = false;
										$temp_obj2->addRegistration($obj1); 					break;
				}
			}
			if ($newObject) {
				$obj2->initRegistrations();
				$obj2->addRegistration($obj1); 			}
			$results[] = $obj1;
		}
		return $results;
	}


	
	public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null)
	{
		$criteria = clone $criteria;

				$criteria->clearSelectColumns()->clearOrderByColumns();
		if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
			$criteria->addSelectColumn(RegistrationPeer::COUNT_DISTINCT);
		} else {
			$criteria->addSelectColumn(RegistrationPeer::COUNT);
		}

				foreach($criteria->getGroupByColumns() as $column)
		{
			$criteria->addSelectColumn($column);
		}

		$criteria->addJoin(RegistrationPeer::REGISTRANT_ID, RegistrantPeer::ID);

		$criteria->addJoin(RegistrationPeer::CONFERENCE_ID, ConferencePeer::ID);

		$rs = RegistrationPeer::doSelectRS($criteria, $con);
		if ($rs->next()) {
			return $rs->getInt(1);
		} else {
						return 0;
		}
	}


	
	public static function doSelectJoinAll(Criteria $c, $con = null)
	{
		$c = clone $c;

				if ($c->getDbName() == Propel::getDefaultDB()) {
			$c->setDbName(self::DATABASE_NAME);
		}

		RegistrationPeer::addSelectColumns($c);
		$startcol2 = (RegistrationPeer::NUM_COLUMNS - RegistrationPeer::NUM_LAZY_LOAD_COLUMNS) + 1;

		RegistrantPeer::addSelectColumns($c);
		$startcol3 = $startcol2 + RegistrantPeer::NUM_COLUMNS;

		ConferencePeer::addSelectColumns($c);
		$startcol4 = $startcol3 + ConferencePeer::NUM_COLUMNS;

		$c->addJoin(RegistrationPeer::REGISTRANT_ID, RegistrantPeer::ID);

		$c->addJoin(RegistrationPeer::CONFERENCE_ID, ConferencePeer::ID);

		$rs = BasePeer::doSelect($c, $con);
		$results = array();

		while($rs->next()) {

			$omClass = RegistrationPeer::getOMClass();


			$cls = Propel::import($omClass);
			$obj1 = new $cls();
			$obj1->hydrate($rs);


					
			$omClass = RegistrantPeer::getOMClass();


			$cls = Propel::import($omClass);
			$obj2 = new $cls();
			$obj2->hydrate($rs, $startcol2);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj2 = $temp_obj1->getRegistrant(); 				if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
					$newObject = false;
					$temp_obj2->addRegistration($obj1); 					break;
				}
			}

			if ($newObject) {
				$obj2->initRegistrations();
				$obj2->addRegistration($obj1);
			}


					
			$omClass = ConferencePeer::getOMClass();


			$cls = Propel::import($omClass);
			$obj3 = new $cls();
			$obj3->hydrate($rs, $startcol3);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj3 = $temp_obj1->getConference(); 				if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
					$newObject = false;
					$temp_obj3->addRegistration($obj1); 					break;
				}
			}

			if ($newObject) {
				$obj3->initRegistrations();
				$obj3->addRegistration($obj1);
			}

			$results[] = $obj1;
		}
		return $results;
	}


	
	public static function doCountJoinAllExceptRegistrant(Criteria $criteria, $distinct = false, $con = null)
	{
				$criteria = clone $criteria;

				$criteria->clearSelectColumns()->clearOrderByColumns();
		if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
			$criteria->addSelectColumn(RegistrationPeer::COUNT_DISTINCT);
		} else {
			$criteria->addSelectColumn(RegistrationPeer::COUNT);
		}

				foreach($criteria->getGroupByColumns() as $column)
		{
			$criteria->addSelectColumn($column);
		}

		$criteria->addJoin(RegistrationPeer::CONFERENCE_ID, ConferencePeer::ID);

		$rs = RegistrationPeer::doSelectRS($criteria, $con);
		if ($rs->next()) {
			return $rs->getInt(1);
		} else {
						return 0;
		}
	}


	
	public static function doCountJoinAllExceptConference(Criteria $criteria, $distinct = false, $con = null)
	{
				$criteria = clone $criteria;

				$criteria->clearSelectColumns()->clearOrderByColumns();
		if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
			$criteria->addSelectColumn(RegistrationPeer::COUNT_DISTINCT);
		} else {
			$criteria->addSelectColumn(RegistrationPeer::COUNT);
		}

				foreach($criteria->getGroupByColumns() as $column)
		{
			$criteria->addSelectColumn($column);
		}

		$criteria->addJoin(RegistrationPeer::REGISTRANT_ID, RegistrantPeer::ID);

		$rs = RegistrationPeer::doSelectRS($criteria, $con);
		if ($rs->next()) {
			return $rs->getInt(1);
		} else {
						return 0;
		}
	}


	
	public static function doSelectJoinAllExceptRegistrant(Criteria $c, $con = null)
	{
		$c = clone $c;

								if ($c->getDbName() == Propel::getDefaultDB()) {
			$c->setDbName(self::DATABASE_NAME);
		}

		RegistrationPeer::addSelectColumns($c);
		$startcol2 = (RegistrationPeer::NUM_COLUMNS - RegistrationPeer::NUM_LAZY_LOAD_COLUMNS) + 1;

		ConferencePeer::addSelectColumns($c);
		$startcol3 = $startcol2 + ConferencePeer::NUM_COLUMNS;

		$c->addJoin(RegistrationPeer::CONFERENCE_ID, ConferencePeer::ID);


		$rs = BasePeer::doSelect($c, $con);
		$results = array();

		while($rs->next()) {

			$omClass = RegistrationPeer::getOMClass();

			$cls = Propel::import($omClass);
			$obj1 = new $cls();
			$obj1->hydrate($rs);

			$omClass = ConferencePeer::getOMClass();


			$cls = Propel::import($omClass);
			$obj2  = new $cls();
			$obj2->hydrate($rs, $startcol2);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj2 = $temp_obj1->getConference(); 				if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
					$newObject = false;
					$temp_obj2->addRegistration($obj1);
					break;
				}
			}

			if ($newObject) {
				$obj2->initRegistrations();
				$obj2->addRegistration($obj1);
			}

			$results[] = $obj1;
		}
		return $results;
	}


	
	public static function doSelectJoinAllExceptConference(Criteria $c, $con = null)
	{
		$c = clone $c;

								if ($c->getDbName() == Propel::getDefaultDB()) {
			$c->setDbName(self::DATABASE_NAME);
		}

		RegistrationPeer::addSelectColumns($c);
		$startcol2 = (RegistrationPeer::NUM_COLUMNS - RegistrationPeer::NUM_LAZY_LOAD_COLUMNS) + 1;

		RegistrantPeer::addSelectColumns($c);
		$startcol3 = $startcol2 + RegistrantPeer::NUM_COLUMNS;

		$c->addJoin(RegistrationPeer::REGISTRANT_ID, RegistrantPeer::ID);


		$rs = BasePeer::doSelect($c, $con);
		$results = array();

		while($rs->next()) {

			$omClass = RegistrationPeer::getOMClass();

			$cls = Propel::import($omClass);
			$obj1 = new $cls();
			$obj1->hydrate($rs);

			$omClass = RegistrantPeer::getOMClass();


			$cls = Propel::import($omClass);
			$obj2  = new $cls();
			$obj2->hydrate($rs, $startcol2);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj2 = $temp_obj1->getRegistrant(); 				if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
					$newObject = false;
					$temp_obj2->addRegistration($obj1);
					break;
				}
			}

			if ($newObject) {
				$obj2->initRegistrations();
				$obj2->addRegistration($obj1);
			}

			$results[] = $obj1;
		}
		return $results;
	}

	
	public static function getTableMap()
	{
		return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
	}

	
	public static function getOMClass()
	{
		return RegistrationPeer::CLASS_DEFAULT;
	}

	
	public static function doInsert($values, $con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(self::DATABASE_NAME);
		}

		if ($values instanceof Criteria) {
			$criteria = clone $values; 		} else {
			$criteria = $values->buildCriteria(); 		}

		$criteria->remove(RegistrationPeer::ID); 

				$criteria->setDbName(self::DATABASE_NAME);

		try {
									$con->begin();
			$pk = BasePeer::doInsert($criteria, $con);
			$con->commit();
		} catch(PropelException $e) {
			$con->rollback();
			throw $e;
		}

		return $pk;
	}

	
	public static function doUpdate($values, $con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(self::DATABASE_NAME);
		}

		$selectCriteria = new Criteria(self::DATABASE_NAME);

		if ($values instanceof Criteria) {
			$criteria = clone $values; 
			$comparison = $criteria->getComparison(RegistrationPeer::ID);
			$selectCriteria->add(RegistrationPeer::ID, $criteria->remove(RegistrationPeer::ID), $comparison);

		} else { 			$criteria = $values->buildCriteria(); 			$selectCriteria = $values->buildPkeyCriteria(); 		}

				$criteria->setDbName(self::DATABASE_NAME);

		return BasePeer::doUpdate($selectCriteria, $criteria, $con);
	}

	
	public static function doDeleteAll($con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(self::DATABASE_NAME);
		}
		$affectedRows = 0; 		try {
									$con->begin();
			$affectedRows += BasePeer::doDeleteAll(RegistrationPeer::TABLE_NAME, $con);
			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	 public static function doDelete($values, $con = null)
	 {
		if ($con === null) {
			$con = Propel::getConnection(RegistrationPeer::DATABASE_NAME);
		}

		if ($values instanceof Criteria) {
			$criteria = clone $values; 		} elseif ($values instanceof Registration) {

			$criteria = $values->buildPkeyCriteria();
		} else {
						$criteria = new Criteria(self::DATABASE_NAME);
			$criteria->add(RegistrationPeer::ID, (array) $values, Criteria::IN);
		}

				$criteria->setDbName(self::DATABASE_NAME);

		$affectedRows = 0; 
		try {
									$con->begin();
			
			$affectedRows += BasePeer::doDelete($criteria, $con);
			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	public static function doValidate(Registration $obj, $cols = null)
	{
		$columns = array();

		if ($cols) {
			$dbMap = Propel::getDatabaseMap(RegistrationPeer::DATABASE_NAME);
			$tableMap = $dbMap->getTable(RegistrationPeer::TABLE_NAME);

			if (! is_array($cols)) {
				$cols = array($cols);
			}

			foreach($cols as $colName) {
				if ($tableMap->containsColumn($colName)) {
					$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
					$columns[$colName] = $obj->$get();
				}
			}
		} else {

		}

		$res =  BasePeer::doValidate(RegistrationPeer::DATABASE_NAME, RegistrationPeer::TABLE_NAME, $columns);
    if ($res !== true) {
        $request = sfContext::getInstance()->getRequest();
        foreach ($res as $failed) {
            $col = RegistrationPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
            $request->setError($col, $failed->getMessage());
        }
    }

    return $res;
	}

	
	public static function retrieveByPK($pk, $con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(self::DATABASE_NAME);
		}

		$criteria = new Criteria(RegistrationPeer::DATABASE_NAME);

		$criteria->add(RegistrationPeer::ID, $pk);


		$v = RegistrationPeer::doSelect($criteria, $con);

		return !empty($v) > 0 ? $v[0] : null;
	}

	
	public static function retrieveByPKs($pks, $con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(self::DATABASE_NAME);
		}

		$objs = null;
		if (empty($pks)) {
			$objs = array();
		} else {
			$criteria = new Criteria();
			$criteria->add(RegistrationPeer::ID, $pks, Criteria::IN);
			$objs = RegistrationPeer::doSelect($criteria, $con);
		}
		return $objs;
	}

} 
if (Propel::isInit()) {
			try {
		BaseRegistrationPeer::getMapBuilder();
	} catch (Exception $e) {
		Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
	}
} else {
			require_once 'lib/model/map/RegistrationMapBuilder.php';
	Propel::registerMapBuilder('lib.model.map.RegistrationMapBuilder');
}
